<template>
  <el-container>
    <el-header>Header</el-header>
    <el-container>
      <el-aside width="200px">
          <el-menu router
            default-active="2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>导航一</span>
              </template>
              <el-menu-item-group>
                <template slot="title">商品管理</template>
                <el-menu-item index="/list"><i class="el-icon-s-home"></i>商品列表</el-menu-item>
                <el-menu-item index="/add"><i class="el-icon-user"></i>添加商品</el-menu-item>
                 <el-menu-item index="/update"><i class="el-icon-user"></i>修改商品</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
      </el-aside>
      <el-main>
        <!-- 占位符 -->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>

   export default {
      methods: {
        handleOpen(key, keyPath) {
          //console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
          //console.log(key, keyPath);
        }
      }
    }
</script>

<style>
  .el-container{
    height: 1000px;
  }
  .el-header{
    background-color: #42b983;
  }
  .el-aside{
    background-color: aquamarine;
  }
  .el-main{
    background-color: bisque;
  }
</style>
